package org.zxyj.web.shiro.filter;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.shiro.authc.AuthenticationToken;
import org.zxyj.web.shiro.token.UsernamePasswordToken;

/**
 * @author zhaoyong
 * @version 2016年3月1日
 */
public class FormAuthenticationFilter extends org.apache.shiro.web.filter.authc.FormAuthenticationFilter {

	@Override
	protected AuthenticationToken createToken(String username, String password, ServletRequest request,
			ServletResponse response) {
		boolean rememberMe = isRememberMe(request);
		String host = getHost(request);
		String identify = request.getParameter("identify");
		AuthenticationToken token = new UsernamePasswordToken(username, password, rememberMe, host, identify);
		return token;
	}

}